package tuioZones;

import java.awt.Color;

public class GamingZone {
	private PointXY coord;
	private float height, width;
	private int r,g,b;
	
	public GamingZone(float xIn, float yIn, float width, float height, int r, int g, int b) {
		this.coord = new PointXY(xIn,yIn);
		this.width = width;
		this.height = height;
		this.r = r;
		this.g = g;
		this.b = b;
	}
	
	public Color getColor() {
		return new Color(12,34,56);
	}
	
	/**
	 * @return the x
	 */
	public float getX() {
		return coord.getX();
	}

	/**
	 * @param x the x to set
	 */
	public void setX(float x) {
		this.coord.setX(x);
	}

	/**
	 * @return the y
	 */
	public float getY() {
		return coord.getY();
	}

	/**
	 * @param y the y to set
	 */
	public void setY(float y) {
		this.coord.setY(y);
	}

	/**
	 * @return the height
	 */
	public float getHeight() {
		return height;
	}

	/**
	 * @param height the height to set
	 */
	public void setHeight(float height) {
		this.height = height;
	}

	/**
	 * @return the width
	 */
	public float getWidth() {
		return width;
	}

	/**
	 * @param width the width to set
	 */
	public void setWidth(float width) {
		this.width = width;
	}
	
	/**
	 * @return the r
	 */
	public int getR() {
		return highlight() ? r + 20 : r;
	}

	/**
	 * @param r the r to set
	 */
	public void setR(int r) {
		this.r = r;
	}

	/**
	 * @return the g
	 */
	public int getG() {
		return highlight() ? g + 20 : g;
	}

	/**
	 * @param g the g to set
	 */
	public void setG(int g) {
		this.g = g;
	}

	/**
	 * @return the b
	 */
	public int getB() {
		return highlight() ? b + 20 : b;
	}

	/**
	 * @param b the b to set
	 */
	public void setB(int b) {
		this.b = b;
	}
	
	private boolean highlight() {
		return false;
	}

	public boolean containsPoint(PointXY point) {
		return point.getX() >= coord.getX() && 
		       point.getX() <= (coord.getX() + width) &&
		       point.getY() >= coord.getY() &&
		       point.getY() <= (coord.getY() + height);
	}
}
